//
//  LCSendTextCell.m
//  安好医生端
//
//  Created by 付国强 on 14-8-15.
//  Copyright (c) 2014年 lianchuangbrother. All rights reserved.
//

#import "LCSendTextCell.h"

@implementation LCSendTextCell

- (void)awakeFromNib
{
    // Initialization code
    UILongPressGestureRecognizer *longPress=[[UILongPressGestureRecognizer alloc]initWithTarget:self action:@selector(dolongPress:)];
    self.messageLabel.userInteractionEnabled=YES;
    [self.messageLabel addGestureRecognizer:longPress];
}
- (void)dolongPress:(UILongPressGestureRecognizer *)recognizer
{
    if (recognizer.state == UIGestureRecognizerStateBegan) {
        //   TSTableViewCell *cell = (TSTableViewCell *)recognizer.view;
        [_emojiLabel becomeFirstResponder];
        //        UIMenuItem *flag = [[UIMenuItem alloc] initWithTitle:@"复制" action:@selector(flag:)];
        //        UIMenuItem *approve = [[UIMenuItem alloc] initWithTitle:@"粘贴" action:@selector(approve:)];
        //
        UIMenuController *menu = [UIMenuController sharedMenuController];
        //        [menu setMenuItems:[NSArray arrayWithObjects:flag, approve, nil]];
        [menu setTargetRect: self.backImageView.frame inView:self];
        [menu setMenuVisible:YES animated:YES];
    }
}
- (void)flag:(id)sender {
    NSLog(@"Cell was flagged");
}

- (void)approve:(id)sender {
    NSLog(@"Cell was approved");
}

-(BOOL)canPerformAction:(SEL)action withSender:(id)sender{
    NSLog(@"(((((=%@",sender);
    if (action == @selector(flag:)||action == @selector(approve:) ){
        return YES;
    }
    return NO;
    
}
- (void)setSelected:(BOOL)selected animated:(BOOL)animated
{
    [super setSelected:selected animated:animated];

    // Configure the view for the selected state
}

@end
